package com.atguigu3.util;

import java.util.List;

import com.atguigu3.bean.Customer;
import com.atguigu3.bean.Order;
import com.atguigu4.Exercise2.ExerciseTest2;
import com.atguigu4.Exercise2.Swx01;
import com.atguigu4.Exercise2.Swxo2;

public class CommonUpdateTest {
	public static void main(String[] args) {
//		String sql = "delete from customers where id = ? ";
//		JDBCUtils.update(sql, 19);
//		String sql = "update `order` set order_name = ? where order_id = ? ";
//		JDBCUtils.update(sql,"DD", 2);
//		String sql = "select name,email from customers where name = ? ";
//		Customer c = JDBCUtils.CustomerCommonForQuery(sql, "周杰伦");
//		System.out.println(c);
//		String sql = "select order_id orderid,order_name orderName,order_date orderdate from `order` where order_id = ? ";
//		Order o = JDBCUtils.OrderCommonForQuery(sql, 1);
//		System.out.println(o);
//		String sql = "select id,name,email,birth from customers where id < ? ";
//		List<Customer> custList = JDBCUtils.testGetForList(Customer.class, sql, 12);
//		for(Customer c : custList)
//		{
//			System.out.println(c);
//		}
		//正则表达式
//		String sql = "select order_id orderid,order_name orderName,order_date orderdate from `order`";
//	    List<Order> orderList = JDBCUtils.testGetForList(Order.class,sql);
//	    orderList.forEach(System.out :: println);
//		String sql = "insert into swx01 values(?,?,?,?,?,?)";
//		ExerciseTest2.update(sql,1004,"憨狗","020708","2001-01-08",89,5000);
//		String sql = "delete from swx01 where number = ? ";
//		String sql = "update swx01 set salary = ? where number = ? ";
//		ExerciseTest2.update(sql,100,1002);
//		String sql = "select number,name,password,birthday,score,salary from swx01 where number < ?";
//		List<Swx01> list = ExerciseTest2.getData(Swx01.class,sql,1004);
//		list.forEach(System.out :: println);
		String sql = "select id,name,age from swxo2 where id < ?";
		List<Swxo2> list = ExerciseTest2.getData(Swxo2.class,sql,1004);
		list.forEach(System.out ::println);
	}

}
